package com.dragon.modules.yuegou.service.wallet;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.service.IService;
import com.dragon.common.web.PageRequest;
import com.dragon.modules.yuegou.entity.wallet.MerchantWithdrawEntity;
import com.dragon.modules.yuegou.model.system.Document;
import com.dragon.modules.yuegou.model.wallet.MerchantWithdraw;
import com.dragon.modules.yuegou.query.wallet.MerchantWithdrawQuery;
import com.dragon.modules.yuegou.query.wallet.WithdrawQuery;
import com.dragon.modules.yuegou.response.WithdrawCheck;

import java.math.BigDecimal;
import java.util.List;
/**
 * 商户提现 服务接口
 *
 * @author pbuilder generated
 * @date 2019-05-07 19:01:28
 * @version 2.0
 */
public interface MerchantWithdrawService extends IService<MerchantWithdrawEntity> {

	/**
	 * 分页查询提现记录
	 * */
	IPage<MerchantWithdraw> merchantWithdrawRecord(PageRequest page, MerchantWithdrawQuery query);

	/**
	 * 提现查询
	 * @param page
	 * @param withdrawQuery
	 * @return
	 */
	IPage<MerchantWithdraw> searchWithdraw(PageRequest page, WithdrawQuery withdrawQuery);

	/**
	 * 保存提现记录
	 * @param withdraw
	 */
    void saveWithdraw(MerchantWithdraw withdraw);

	/**
	 * 生成审核记录
	 * @param id 用户id
	 * @param money 提现金额
	 */
	void withdrawalCheck(String id, BigDecimal money);
	
	/**
	 * 生成聚合支付返现审核记录
	 */
	MerchantWithdraw aggCashBackCheck(String merchantUserId, BigDecimal money);

	/**
	 * 查询审核列表
	 * @param page
	 * @param withdrawQuery
	 * @return
	 */
    IPage<WithdrawCheck> searchCheckWithdraw(PageRequest page, WithdrawQuery withdrawQuery);

	/**
	 * 修改提现审核记录
	 * @param merchantWithdraw
	 */
	void checkWithdraw(MerchantWithdraw merchantWithdraw);

    /**
     * 导出提现记录
     * @param withdrawQuery
     * @return
     */
    Document exportCheckWithdraw(WithdrawQuery withdrawQuery);

    void disposableCheck(List<String> ids);

	BigDecimal searchMoney(MerchantWithdrawQuery query);

	/**
	 * 提现查询
	 * @param query
	 * @return
	 */
	List<MerchantWithdraw> searchRecord(MerchantWithdrawQuery query);

	/**
	 * 大运营后台对商户线下提现
	 * @param merchantWithdrawQuery
	 */
    void backgroundDeductions(MerchantWithdrawQuery merchantWithdrawQuery);
}